package util

import (
	"strconv"
	"sync/atomic"
)

type SequenceNumber struct {
	value uint64
}

func NewSequence(start uint64) *SequenceNumber {
	return &SequenceNumber{
		value: start,
	}
}

//Next get next sequence number
func (sn *SequenceNumber) Next() string {
	return strconv.FormatUint(atomic.AddUint64(&sn.value, 1), 10)
}
